package icu.zhhll.feign.autoconfiguration;

import com.netflix.hystrix.HystrixCommand;
import icu.zhhll.feign.strategy.FeignHystrixConcurrencyStrategy;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @author zh
 * @date 2023/9/22 11:35
 */
@ConditionalOnClass(HystrixCommand.class)
public class FeignCloudAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public FeignHystrixConcurrencyStrategy feignHystrixConcurrencyStrategy() {
        return new FeignHystrixConcurrencyStrategy();
    }

    // HystrixPlugins.getInstance().registerConcurrencyStrategy(new MdcHystrixConcurrencyStrategy());


}
